package com.zhkj.txg.module.login.vm

import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.zhkj.lib.base.BaseViewModel
import com.zhkj.lib.http.HttpResponse
import com.zhkj.lib.http.ViewModelSubscribeListener
import com.zhkj.lib.utils.AccountManager
import com.zhkj.txg.module.login.entity.BannerResponse
import com.zhkj.txg.module.login.entity.SplashAdResponse
import com.zhkj.txg.module.login.model.LoginManager

class GuideViewModel(application: Application) : BaseViewModel(application) {


    private val manager = LoginManager()

    val bannerLiveData = MutableLiveData<HttpResponse<BannerResponse>>()


    fun getBanner(shopId: String, type: String) {
        val splashAd = manager.getBanner(AccountManager.getToken(), shopId, type, ViewModelSubscribeListener(bannerLiveData))
        dispose.add(splashAd)
    }
}